<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>clear-float</title>
    <style>
        .one{
            float: left;
            width: 200px;
            height: 200px;
            background-color: orange;
        }
        .two{
            float: left;
            width: 300px;
            height: 300px;
            background-color: blue;
        }
        .second-father{
            width: 600px;
            height: 200px;
            background-color: green;
        }
        /* 第一种方法 */
        /* .three{
            clear: both;
        } */
        /* 第二种方法 */
        .father{
            overflow: hidden;
        }
        /* 第三种方法 */
        .clearfix:after{
            content: "";
            display: block;
            height: 0;
            clear: both;
            visibility: hidden;
        }
    </style>
</head>
<body>
    <!-- <div class="father"> -->
    <!-- 第三种方法 -->
    <div class="father clearfix">
        <div class="one"></div>
        <div class="two"></div>
        <!-- 第一种方法 -->
        <!-- <div class="three"></div> -->
    </div>
    <div class="second-father"></div>
</body>
</html>